﻿@{
    Layout = null;
}
<!DOCTYPE html>
<html >
<head>
<meta content="" charset="utf-8" />
<title>@ViewBag.Title</title>
<meta name="description" content="" />
<meta name="keywords" content="" />
<link rel="shortcut icon" type="image/png" href="/styles/img/favicons/favicon.png"/>
<link rel="icon" type="image/png" href="/styles/img/favicons/favicon.png"/>
<link rel="apple-touch-icon" href="/styles/img/favicons/apple.png" />
<link rel="stylesheet" href="/styles/css/style.css" type="text/css" />
<link rel="stylesheet" href="/styles/css/custom.css" type="text/css" />
<script type="text/javascript" src="/scripts/swfobject.js"></script>
<script type="text/javascript" src="/scripts/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="/scripts/jquery.ui.core.min.js"></script>
<script type="text/javascript" src="/scripts/jquery.ui.widget.min.js"></script>
<script type="text/javascript" src="/scripts/jquery.ui.tabs.min.js"></script>
<script type="text/javascript" src="/scripts/jquery.tipTip.min.js"></script>
<script type="text/javascript" src="/scripts/jquery.superfish.min.js"></script>
<script type="text/javascript" src="/scripts/jquery.supersubs.min.js"></script>
<script type="text/javascript" src="/scripts/jquery.validate_pack.js"></script>

<script type="text/javascript">
    $(document).ready(function () {

    });

    //回车时，默认是登陆
    function on_return(event) {
        var e = event ? event : (window.event ? window.event : null);
        if (e.keyCode == 13) {
            btnLogon();
        }
    }

    function btnLogon() {
        var username = $.trim($("#txt_username").val());
        var password = $("#txt_password").val();
        var yzm = $("#yzm").val();
        var check = "0";
        var data = "&accountName=" + username + "&Pwd=" + password + "&yzm=" + yzm + "&check=" + check;
        $.ajax({
            async: false,
            type: "POST",
            url: "/IMS/Account/LogOnSchool",
            dataType: "json",
            data: data,
            success: function (data) {
                switch (data) {
                    case "1": alert("驾校账号不能为空"); reloadcode_stu();
                        break;
                    case "2": alert("密码不能为空！"); reloadcode_stu();
                        break;
                    case "3": alert("验证码不能为空"); reloadcode_stu();
                        break;
                    case "4": alert("验证码不正确！"); reloadcode_stu();
                        break;
                    case "5": location.href = "/IMS/Account/Infos";
                        break;
                    case "6": alert("用户名不存在！"); reloadcode_stu();
                        break;
                    case "7": alert("用户密码错误！"); reloadcode_stu();
                        break;
                    case "8": alert("用户名格式错误！"); reloadcode_stu();
                        break;
                    case "9": alert("密码格式错误"); reloadcode_stu();
                        break;
                    case "10": alert('用户被锁定或者过期！'); reloadcode_stu();
                        break;
                    default: alert("登录失败!"); reloadcode_stu();
                        break;
                }

            },
            error: function (XMLHttpRequest, textStatus, errorThrown) {
                alert('请求出现异常，请稍后再试'); reloadcode_stu();
            }

        });
    }
</script>
</head>
<body  onkeydown="on_return(event);">
<header id="top">
<div class="wrapper-login">
<div id="title"><img src="/styles/img/logo.png" alt="Administry" /></div>
<nav id="menu">
<ul class="sf-menu">
<li class="current"><a href="#">驾校登录</a></li>
</ul>
</nav>
<aside><a href="#">在线客服</a> &middot; <a href="#">说明</a></aside>
</div>
</header>
<div id="pagetitle">
<div class="wrapper-login"></div>
</div>
<div id="page">
<div id="mup_lg" class="wrapper-login">
<div class="full">					
<h3>驾校管理系统</h3>
<div class="box box-info">使用用户名/密码登陆系统<br /><br /></div>
<div id="mlogin">
<p>
<label class="required" for="username">账号:</label><br/>
<input type="text" id="txt_username" class="full" value="" name="username"/>
</p>
<p>
<label class="required" for="password">密码:</label><br/>
<input type="password" id="txt_password" class="full" value="" name="password"/>
</p>
<p>
<label class="required" for="yam">验证码:</label><br/>
<input type="text" id="yzm" name="yzm" class="loginyzm"/>
              <img alt="验证码" id="Img1" class="yzmimg" src="@Url.Action("CreateImageCode", "SecurityCode")" onclick="reloadcode_stu()"  />
                <script type="text/javascript">
                    function reloadcode_stu() {
                        var verify = document.getElementById('Img1');
                        verify.setAttribute('src', '@Url.Content("~/SecurityCode/CreateImageCode?")' + Math.random());
                    }
                    $(function () {
                        $("#Img1").click();
                    });
                </script>
</p>
@*<p>
<input type="checkbox" id="checkPwd" class="" name="checkPwd"/>
<label class="choice" for="checkPwd">记住密码?</label>
</p>*@

<div class="clear">&nbsp;</div>
</div>
<input type="button" class="btn btn-green big" value="登 录" onclick="btnLogon()" />			
<div id="emailform" style="display:none" >
<div class="box">
<p id="emailinput">
<label for="email">Email:</label><br/>
<input type="text" id="email" class="full" value="" name="email"/>
</p>
<p>
<input type="submit" class="btn" value="Send"/>
</p>
</div>
</div>
</div> 
</div>
</div>

@Html.Partial("_Footer")
</body>
</html>